/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.unal.bioingenium.kbmed.knowledge.similarity.vo;

import gnu.trove.map.hash.TObjectFloatHashMap;
import java.util.Comparator;

/**
 *
 * @author Ing. Alejandro Riveros Cruz
 */
public class NeighborSimilarityComparator implements Comparator<String> {

    /**
     * 
     */
    private TObjectFloatHashMap<String> similarityValuesMap;

    /**
     * 
     * @param similarityValuesMap
     */
    public NeighborSimilarityComparator(TObjectFloatHashMap<String> similarityValuesMap) {
        this.similarityValuesMap = similarityValuesMap;
    }

    @Override
    public int compare(String o1, String o2) {
        float d1 = similarityValuesMap.get(o1);
        float d2 = similarityValuesMap.get(o2);
        return -Float.compare(d1, d2);
    }
}
